from django.db import models

# Create your models here.
class Brand(models.Model):
    name = models.CharField(max_length=50)
    desc = models.CharField(max_length=200)

    def __str__(self):
        return self.name
    class Meta:
        db_table = 'brand'

class Goods(models.Model):
    goodname = models.CharField(max_length=50)
    price = models.DecimalField(max_digits=10, decimal_places=2)
    number = models.IntegerField()
    brand = models.ForeignKey(Brand, on_delete=models.CASCADE)
    def __str__(self):
        return self.goodname
    class Meta:
        db_table = 'goods'